package com.shiku.im.redpack.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.ArrayList;
import java.util.List;

///红包实体
@ApiModel("红包实体")
@Document(value="RedPacket")
public class RedPacket {

	@ApiModelProperty("编号")
	private @Id ObjectId id;
	//发送者用户Id
	@ApiModelProperty("用户编号")
	@Indexed
	private int userId;

	@ApiModelProperty("发送到那个房间")
	private String roomJid;// 发送到那个房间
	@ApiModelProperty("发送给那个人")
	private @Indexed int toUserId;// 发送给那个人
	
	//红包发送者昵称
	@ApiModelProperty("红包发送者昵称")
	private String userName;
	//祝福语
	@ApiModelProperty("祝福语")
	private String greetings;
	//祝福语copy
	@ApiModelProperty("祝福语copy")
	private String greetingsCopy;
	//发送时间
	@ApiModelProperty("发送时间")
	private long sendTime;

	//红包类型

	/**
	 *  1：普通红包  2：拼手气红包  3:口令红包  4 固定金额红包 5 专属红包
	 */
	@ApiModelProperty("红包类型")
	@Indexed
	private  int type;
	//红包个数
	@ApiModelProperty("红包个数")
	private int count;
	//已领取个数
	@ApiModelProperty("已领取个数")
	private int receiveCount=0;
	//红包金额
	@ApiModelProperty("红包金额")
	private Double money;
	
	//红包剩余金额
	@ApiModelProperty("红包剩余金额")
	private Double over;

	//超时时间
	@ApiModelProperty("超时时间")
	private long outTime;
	//红包状态
	@ApiModelProperty("红包状态")
	private @Indexed int status=1; // 1 ：发出   2：已领完       -1：已退款        //3:未领完退款
	
	//领取该红包的 userId
	@ApiModelProperty("领取该红包的 userId")
	private List<Integer> userIds=new ArrayList<Integer>();

	private List<Double> moneyList;

	private String yopRedPacketId;// 易宝的红包Id

	private boolean isSenderWin;//发包者必赢

	private ArrayList<Integer> winCount;//第几个赢

	public RedPacket() {
	}

	public RedPacket(int userId, String roomJid, int toUserId, String greetings, int type, int count, Double money, List<Double> moneyList, String yopRedPacketId) {
		this.userId = userId;
		this.roomJid = roomJid;
		this.toUserId = toUserId;
		this.greetings = greetings;
		this.type = type;
		this.count = count;
		this.money = money;
		this.moneyList = moneyList;
		this.yopRedPacketId = yopRedPacketId;
	}

	public ObjectId getId() {
		return id;
	}
	public void setId(ObjectId id) {
		this.id = id;
	}

	public ArrayList<Integer> getWinCount() {
		return winCount;
	}

	public void setWinCount(ArrayList<Integer> winCount) {
		this.winCount = winCount;
	}

	public boolean isSenderWin() {
		return isSenderWin;
	}

	public void setSenderWin(boolean senderWin) {
		isSenderWin = senderWin;
	}

	public String getGreetingsCopy() {
		return greetingsCopy;
	}

	public void setGreetingsCopy(String greetingsCopy) {
		this.greetingsCopy = greetingsCopy;
	}
	
	public String getRoomJid() {
		return roomJid;
	}
	public void setRoomJid(String roomJid) {
		this.roomJid = roomJid;
	}
	public String getGreetings() {
		return greetings;
	}
	public void setGreetings(String greetings) {
		this.greetings = greetings;
	}
	public long getSendTime() {
		return sendTime;
	}
	public void setSendTime(long sendTime) {
		this.sendTime = sendTime;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	public int getReceiveCount() {
		return receiveCount;
	}
	public void setReceiveCount(int receiveCount) {
		this.receiveCount = receiveCount;
	}
	public Double getMoney() {
		return money;
	}
	public void setMoney(Double money) {
		this.money = money;
	}
	public long getOutTime() {
		return outTime;
	}
	public void setOutTime(long outTime) {
		this.outTime = outTime;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public List<Integer> getUserIds() {
		return userIds;
	}
	public void setUserIds(List<Integer> userIds) {
		this.userIds = userIds;
	}
	public Double getOver() {
		return over;
	}
	public void setOver(Double over) {
		this.over = over;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	public int getToUserId() {
		return toUserId;
	}
	public void setToUserId(int toUserId) {
		this.toUserId = toUserId;
	}


	public String getYopRedPacketId() {
		return yopRedPacketId;
	}

	public void setYopRedPacketId(String yopRedPacketId) {
		this.yopRedPacketId = yopRedPacketId;
	}

	public List<Double> getMoneyList() {
		return moneyList;
	}

	public void setMoneyList(List<Double> moneyList) {
		this.moneyList = moneyList;
	}
}
